<%--
  Created by IntelliJ IDEA.
  User: tao95
  Date: 2017/5/7
  Time: 18:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    String staticPath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
%>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="/static/css/pintuer.css">
    <link rel="stylesheet" href="/static/css/admin.css">
    <script src="/static/js/jquery.js"></script>
    <script src="/static/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>课程表添加/修改</strong></div>
    <div class="body-content">
        <form method="post" class="form-x" action="<%=basePath %>ctr/addCTR">
            <input type="hidden" name="id"  value="${ctr.id}" />
                <div class="form-group">
                    <div class="label">
                        <label>选择实验室：</label>
                    </div>
                    <div class="field">
                        <select name="laboratoryId" class="input w50">
                            <c:forEach var="item" items="${labList}">
                                <c:choose>
                                    <c:when test="${item.id == ctr.laboratoryId}">
                                        <option selected="selected" value="${item.id}">${item.name}</option>
                                    </c:when>
                                    <c:otherwise>
                                        <option value="${item.id}">${item.name}</option>
                                    </c:otherwise>
                                </c:choose>

                            </c:forEach>
                        </select>
                        <div class="tips"></div>
                    </div>
                </div>
            <div class="form-group">
                <div class="label">
                    <label>选择班级：</label>
                </div>
                <div class="field">
                    <select name="classId" class="input w50">
                        <c:forEach var="item" items="${classList}">
                            <c:choose>
                                <c:when test="${item.id == ctr.classId}">
                                    <option selected="selected" value="${item.id}">${item.className}</option>
                                </c:when>
                                <c:otherwise>
                                    <option value="${item.id}">${item.className}</option>
                                </c:otherwise>
                            </c:choose>
                        </c:forEach>
                    </select>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>选择教师：</label>
                </div>
                <div class="field">
                    <select name="teacherId" class="input w50">
                        <c:forEach var="item" items="${teacherList}">
                            <c:choose>
                                <c:when test="${item.id == ctr.teacherId}">
                                    <option selected="selected" value="${item.id}">${item.teacherName}</option>
                                </c:when>
                                <c:otherwise>
                                    <option value="${item.id}">${item.teacherName}</option>
                                </c:otherwise>
                            </c:choose>

                        </c:forEach>
                    </select>
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>选择课程：</label>
                </div>
                <div class="field">
                    <select name="courseId" class="input w50">
                        <c:forEach var="item" items="${courseList}">
                            <c:choose>
                                <c:when test="${item.id == ctr.courseId}">
                                    <option selected="selected" value="${item.id}">${item.courseName}</option>
                                </c:when>
                                <c:otherwise>
                                    <option value="${item.id}">${item.courseName}</option>
                                </c:otherwise>
                            </c:choose>
                        </c:forEach>
                    </select>
                    <div class="tips"></div>
                </div>
            </div>
            <c:if test="${ctr == null}">
                <div class="form-group">
                    <div class="label">
                        <label>选择星期：</label>
                    </div>
                    <div class="field">
                        <select name="daysId" class="input w50">
                            <option value="1">星期一</option>
                            <option value="2">星期二</option>
                            <option value="3">星期三</option>
                            <option value="4">星期四</option>
                            <option value="5">星期五</option>
                        </select>
                        <div class="tips"></div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">
                        <label>选择节次：</label>
                    </div>
                    <div class="field">
                        <select name="courseTime" class="input w50">
                            <option value="1">第一节</option>
                            <option value="2">第二节</option>
                            <option value="3">第三节</option>
                            <option value="4">第四节</option>
                        </select>
                        <div class="tips"></div>
                    </div>
                </div>
            </c:if>

            <div class="form-group">
                <div class="label">
                    <label>备注：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="${ctr.remark}" name="remark" data-validate="required:请输入标题" />
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>

</body></html>
